<!-- <!doctype html> -->
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js绘制数学函数</title>
</head>

<body>
<div id="main" style="border-bottom:solid red 0px;height:100%;width:100%"></div>
</body>
<script>
    function fn() {
        this.a = 30;
        this.b = function() {
            console.log(this.a)
        }
    }
    fn.prototype = {
        b: function() {
            this.a = 20;
            console.log(this.a);
        },
        c: function() {
            this.a = 30;
            console.log(this.a);
        }
    }
    var myfn = new fn();
    myfn.b();
    myfn.c();
</script>
<script>
    function A(name){
        this.name = name;
        this.sayHello = function(){

        };
    }
    function B(name,id){
        this.temp = A;
        this.temp(name);        //相当于new A();
        delete this.temp;
        this.id = id;
        this.checkId = function(ID){alert(this.id==ID)};
    }
    var ss=new  B()
    ss.sayHello();

    (function () {
        var name = 'World!';
        if (typeof name ==='number') {
            var name = 'Jack';
            console.log('Goodbye ' + name);
        } else {
            console.log('Hello ' + name);
        }
    })();
</script>
</html>